package com.dc.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@TableName("sys_user")
@Data
@ApiModel
public class SysUser implements Serializable {

    private static final long serialVersionUID = 4101344022889714739L;
    @TableId(type = IdType.INPUT)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 登录名
     */
    @ApiModelProperty(value = "登录名")
    private String loginName;
    /**
     * 密码
     */
    @JsonIgnore
    private String password;
    /**
     * 姓名
     */
    @ApiModelProperty(value = "姓名")
    private String userName;
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号")
    private String mobile;
    /**
     * 是否超级管理员(0：不是、1：是)
     */
    private Integer isSuper;
    /**
     * 登录token(记住密码)
     */
    private String token;
    /**
     * 头像
     */
    @ApiModelProperty(value = "头像")
    private String portrait;
    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    /**
     * 更新时间
     */
    private Date updateTime;
    /**
     * 最后登录时间
     */
    @ApiModelProperty(value = "最后登录时间")
    private Date lastLoginTime;

    /**
     * 状态(0：正常)
     */
    private Integer status;
    /**
     * 编号
     */
    private String cardNumber;

    private String tenantId;

    @ApiModelProperty(value = "性别 0:男  1：女")
    private Integer sex;


    @ApiModelProperty(value = "个人描述")
    private String description;


    @TableField(exist = false)
    @ApiModelProperty(value = "角色集合")
    private List<SysRole> roleList = new ArrayList<>();

    private int errorCount;
}
